import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home'
import Journalism from '@/views/Journalism'
import Sports from '@/views/Sports'
import SportsHome from '@/views/sports/SportsHome'
import Internal from '@/views/sports/Internal'
import Foreign from '@/views/sports/Foreign'
/* 三级路由 */
import UIRouter from '@/views/UIRouter'
import Contacts from '@/views/Contacts'
import About from '@/views/About'
import Allcontacts from '@/views/Contacts/Allcontacts'
import Alice from '@/views/Contacts/Alice'
import Bob from '@/views/Contacts/Bob'
import Blog from '@/views/Contacts/Bob/Blog'
import Fax from '@/views/Contacts/Bob/Fax'
Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      path: '/home',
      component: Home,
    },
    {
      path: '/journalism',
      component: Journalism,
    },
    {
      path: '/sports',
      component: Sports,
      children: [
        {
          path: 'sportshome',
          component: SportsHome,
        },
        {
          path: 'internal',
          component: Internal,
        },
        {
          path: 'foreign',
          component: Foreign,
        },
      ],
    },
    //三级路由
    {
      path: '/uirouter',
      component: UIRouter,
    },
    {
      path: '/contacts',
      component: Contacts,
      children: [
        {
          path: 'allcontacts',
          component: Allcontacts,
        },
        {
          path: 'alice',
          component: Alice,
        },
        {
          path: 'bob',
          component: Bob,
          children: [
            {
              path: 'blog',
              component: Blog,
            },
            {
              path: 'fax',
              component: Fax,
            },
          ],
        },
      ],
    },
    {
      path: '/about',
      component: About,
    },
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: 'article',
          component: Article,
        },
        {
          path: 'collect',
          component: Collect,
        },
        {
          path: 'like',
          component: Like,
        },
        {
          path: 'user',
          component: User,
        },
      ],
    },
    {
      path: '/detail/:id',
      component: ArticleDetail,
    },
  ],
})
